package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.system.api.RemoteRoleService;
import com.ruoyi.system.api.RemoteUserService;
import com.ruoyi.system.api.domain.SysRole;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author wangsr
 * @date 2022-1-2 21:54
 * @description
 */
@Component
public class RemoteRoleFallbackFactory implements FallbackFactory<RemoteRoleService> {
    @Override
    public RemoteRoleService create(Throwable cause) {
        return new RemoteRoleService() {
            @Override
            public R<List<SysRole>> selectRoleList(SysRole sysRole) {
                throw new ServiceException(cause);
            }
        };
    }
}
